#!/usr/bin/env bash

### BEGIN ###
# Author: idevz
# Since: 2018/03/12
# Description:       Set up Base pvm
# ./init.sh          Set up using $(pwd) as BASE_DIR, down which has go source and binaries.
#
# Environment variables that control init:
# SIP: default static ip.
### END ###

set -e

[ -z ${PRLCTL_HOME} ] && echo "empty PRLCTL_HOME." && exit
STATIC_IP=${SIP:-"10.211.55.100"}
BASE_DIR=${BASE_DIR:-$(dirname $(cd $(dirname "$0") && pwd -P)/$(basename "$0"))}
TAG_PVM_NAME=${T_PNAME:-"centos7-base-1708"}
BASE_PVM_NAME=${B_PNAME:-"CentOS-7-x86_64-Minimal-1708"}

# prlctl clone "${BASE_PVM_NAME}" --name "${TAG_PVM_NAME}"

# manual install parallels tools

scp ~/.ssh/id_rsa.pub z@${STATIC_IP}:~/.ssh/
scp ~/.ssh/id_rsa.pub root@${STATIC_IP}:~/.ssh/
